#!/bin/sh
echo '处理用户行为数据'
currDate=`date +%Y-%m-%d`
#/opt/lagou/servers/hive-2.3.7/bin/hive -e "USE default;INSERT INTO TABLE user_info SELECT COUNT(DISTINCT id) active_num, TO_DATE(click_time) `date` FROM user_clicks WHERE TO_DATE(click_time) = '$currDate' GROUP BY TO_DATE(click_time);"
/opt/lagou/servers/hive-2.3.7/bin/hive -e "USE default;INSERT INTO TABLE user_info SELECT COUNT(DISTINCT id) active_num, TO_DATE(click_time) datestr FROM user_clicks WHERE TO_DATE(click_time) = '20210416' GROUP BY TO_DATE(click_time);"
